package com.zjj.distributed.biz;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhanglei.zjj
 * @description 测试业务-生成订单号
 * @date 2023/6/22 15:12
 */
public class OrderCodeGenerator {
    private static int count = 0;

    /**
     * 生成订单号
     */
    public String getOrderCode() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
        return simpleDateFormat.format(new Date()) + "-" + ++count;
    }
}
